import React, { Component } from "react";
import PropTypes from "prop-types";
import axios from "axios";

class XjjItem extends Component {
  constructor(props) {
    super(props);
  }
  shouldComponentUpdate(nextProps, nextState) {
    return nextProps.item !== this.props.item;
  }
  render() {
    return (
      <div>
        <li
          dangerouslySetInnerHTML={{
            __html: this.props.name + this.props.item,
          }}
          onClick={this.props.onRemove}
        ></li>
      </div>
    );
  }
}
XjjItem.propTypes = {
  name: PropTypes.string.isRequired,
  item: PropTypes.string,
  index: PropTypes.number,
  onRemove: PropTypes.func,
};
XjjItem.defaultProps = {
  name: "FF",
};
export default XjjItem;
